﻿<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:rn="http://birkelund.dk/ReleaseNotes/2011/07/21">
  <xsl:output method="html" indent="yes"/>
  <xsl:template match="/">
    <html>
      <body>
        <h2>
          Release notes for '<xsl:value-of select="//rn:releases/@application"/>'
        </h2>
        <xsl:for-each select="//rn:releases/rn:release">
          <xsl:sort select="@date" order="descending"/>
          ---------------------------------------------------------------------
          <h2>
            Version: <xsl:value-of select="@version"/> (<xsl:value-of select="@date"/>)
          </h2>
          <xsl:if test="@description">            
            <strong>
              Description:
            </strong>
            <xsl:value-of select="@description"/>
            <br />
          </xsl:if>
          <strong>
            Is backward compatible:
          </strong>
          <xsl:value-of select="@isBackwardCompatible"/>

          <xsl:if test="count(.//rn:feature) > 0">
            <h4>Features added</h4>
            <ul>
              <xsl:for-each select=".//rn:feature">
                <li>
                  <xsl:value-of select="."/>
                  <xsl:if test="@taskId">
                    (TaskId: <xsl:value-of select="@taskId" />)
                  </xsl:if>
                </li>
              </xsl:for-each>
            </ul>
          </xsl:if>
          
          <xsl:if test="count(.//rn:defect) > 0">
            <h4>Defects fixed</h4>
            <ul>
              <xsl:for-each select=".//rn:defect">
                <li>
                  <xsl:value-of select="."/>
                  <xsl:if test="@taskId">
                    (TaskId: <xsl:value-of select="@taskId" />)
                  </xsl:if>
                </li>
              </xsl:for-each>
            </ul>
          </xsl:if>
        </xsl:for-each>

      </body>
    </html>
  </xsl:template>
</xsl:stylesheet>
